Imports System
Imports DotNetNuke
Imports System.Data

Namespace SGW.ComunicadorWeb

    Public MustInherit Class DataProvider


#Region "Variables"

        '  Provider constants - eliminates need for Reflection later
        Private Const mDataProviderType As String = "data"
        Private Const mDataNameSpace As String = "SGW.ComunicadorWeb"
        Private Const mDataAssemblyName As String = ""

        Private Shared objProvider As DataProvider = Nothing

#End Region

#Region "Constructor"

        ' constructor
        Shared Sub New()
            CreateProvider()
        End Sub

#End Region

#Region "Public methods"

        ' return the provider
        Public Shared Shadows Function Instance() As DataProvider
            Return objProvider
        End Function

#End Region

#Region "Abstract methods"

        Public MustOverride Function GetComunicadorWebs(ByVal PortalId As Integer, ByVal UserID As Integer) As IDataReader
        Public MustOverride Function GetComunicadorWebsActivos(ByVal PortalId As Integer, ByVal UserID As Integer) As IDataReader
        Public MustOverride Function GetComunicadorWebsCerrados(ByVal PortalId As Integer, ByVal UserID As Integer, ByVal PageSize As Integer, ByVal CurrentPage As Integer) As IDataReader
        'Public MustOverride Function GetComunicadorWebsSorted(ByVal PortalId As Integer, ByVal UserID As Integer, ByVal SortClause As String) As IDataReader
        Public MustOverride Function GetAllComunicadorWebs(ByVal PortalId As Integer) As IDataReader
        'Public MustOverride Function GetAllComunicadorWebsSorted(ByVal PortalId As Integer, ByVal SortClause As String) As IDataReader
        Public MustOverride Function GetComunicadorWeb(ByVal PortalId As Integer, ByVal HiloID As Integer) As IDataReader
        Public MustOverride Function AddComunicadorWeb(ByVal PortalId As Integer, ByVal Hil_FechaCreacion As DateTime, ByVal Hil_Status As Int32, ByVal Hil_UsuarioID As Int32, ByVal Hil_IDUltimoMensaje As Int32, ByVal Hil_Cerrado As Boolean, ByVal Hil_FechaCierre As DateTime, ByVal Hil_PrioridadId As Int32, ByVal Hil_CategoriaID As Int32, ByVal Hil_SubCategoriaID As Int32, ByVal Hil_Asunto As String) As Integer
        Public MustOverride Sub UpdateComunicadorWeb(ByVal PortalId As Integer, ByVal HiloID As Int32, ByVal Hil_FechaCreacion As DateTime, ByVal Hil_Status As Int32, ByVal Hil_UsuarioID As Int32, ByVal Hil_IDUltimoMensaje As Int32, ByVal Hil_Cerrado As Boolean, ByVal Hil_FechaCierre As DateTime, ByVal Hil_PrioridadId As Int32, ByVal Hil_CategoriaID As Int32, ByVal Hil_SubCategoriaID As Int32, ByVal Hil_Asunto As String)
        Public MustOverride Sub DeleteComunicadorWeb(ByVal PortalId As Integer, ByVal HiloID As Integer)
        Public MustOverride Function GetAllComunicadorWebsActivos(ByVal Portalid As Integer) As IDataReader
        Public MustOverride Function CountAllComunicadorWebsActivos(ByVal Portalid As Integer) As Integer
        Public MustOverride Function CountAllComunicadorWebsCerrados(ByVal Portalid As Integer) As Integer
        Public MustOverride Function GetAllComunicadorWebsCerrados(ByVal Portalid As Integer, ByVal PageSize As Integer, ByVal CurrentPage As Integer) As IDataReader
        Public MustOverride Function CountComunicadorWebsCerrados(ByVal PortalID As Integer, ByVal UserID As String) As Integer

        ''' MANTENIMIENTO DE PRIORIDADES
        Public MustOverride Function GetSGW_Prioridades(ByVal pri_ID As Integer) As IDataReader

        Public MustOverride Function GetSGW_PrioridadesByPri_PortalID(ByVal pri_PortalID As Integer) As IDataReader

        'Public MustOverride Function GetAllSGW_Prioridadess() As IDataReader

        Public MustOverride Function AddSGW_Prioridades(ByVal pri_PortalID As Integer, ByVal pri_Nombre As String, ByVal pri_Peso As Integer) As Integer

        Public MustOverride Sub UpdateSGW_Prioridades(ByVal pri_ID As Integer, ByVal pri_PortalID As Integer, ByVal pri_Nombre As String, ByVal pri_Peso As Integer)

        Public MustOverride Sub DeleteSGW_Prioridades(ByVal pri_ID As Integer)

        ' MANTENIMIENTO DE Categorias
        Public MustOverride Function GetSGW_Categorias(ByVal iDCategoria As Integer) As IDataReader

        Public MustOverride Function GetAllSGW_Categoriass(ByVal PortalID As Integer) As IDataReader

        Public MustOverride Function AddSGW_Categorias(ByVal portalID As Integer, ByVal descripcion As String) As Integer

        Public MustOverride Sub UpdateSGW_Categorias(ByVal iDCategoria As Integer, ByVal portalID As Integer, ByVal descripcion As String)

        Public MustOverride Sub DeleteSGW_Categorias(ByVal iDCategoria As Integer)


        ' MANTENIMIENTO DE SUBCategorias
        Public MustOverride Function GetSGW_SubCategorias(ByVal iDSubcategoria As Integer) As IDataReader

        Public MustOverride Function GetSGW_SubCategoriasBySC_PortalID(ByVal sC_PortalID As Integer) As IDataReader

        Public MustOverride Function GetSGW_SubCategoriasBySC_CategoriaID(ByVal sC_CategoriaID As Integer) As IDataReader

        Public MustOverride Function GetAllSGW_SubCategoriass() As IDataReader

        Public MustOverride Function AddSGW_SubCategorias(ByVal sC_PortalID As Integer, ByVal sC_CategoriaID As Integer, ByVal sc_Descripcion As String) As Integer

        Public MustOverride Sub UpdateSGW_SubCategorias(ByVal iDSubcategoria As Integer, ByVal sC_PortalID As Integer, ByVal sC_CategoriaID As Integer, ByVal sc_Descripcion As String)

        Public MustOverride Sub DeleteSGW_SubCategorias(ByVal iDSubcategoria As Integer)

        ' MANTENIMIENTO DE Mensajes

        Public MustOverride Function GetSGW_Mensajes(ByVal mensajeID As Integer) As IDataReader

        Public MustOverride Function GetSGW_MensajesByMen_HiloID(ByVal men_HiloID As Integer) As IDataReader

        Public MustOverride Function GetAllSGW_Mensajess() As IDataReader

        Public MustOverride Function AddSGW_Mensajes(ByVal men_Portal As String, ByVal men_UsuarioID As Integer, ByVal men_HiloID As Integer, ByVal men_FechaMensaje As DateTime, ByVal men_Mensaje As String, ByVal men_IpDesde As String) As Integer

        Public MustOverride Sub UpdateSGW_Mensajes(ByVal mensajeID As Integer, ByVal men_Portal As String, ByVal men_UsuarioID As Integer, ByVal men_HiloID As Integer, ByVal men_FechaMensaje As DateTime, ByVal men_Mensaje As String, ByVal men_IpDesde As String)

        Public MustOverride Sub DeleteSGW_Mensajes(ByVal mensajeID As Integer)


        ' MANTENIMIENTO DE Configuracion

        Public MustOverride Function GetSGW_Configuracion(ByVal idConfig As Integer) As IDataReader

        Public MustOverride Function GetSGW_ConfiguracionBycfg_Descripcion(ByVal cfg_PortalID As Integer, ByVal cfg_Descripcion As String) As String

        Public MustOverride Function GetAllSGW_Configuracions(ByVal Portalid As Integer) As IDataReader

        Public MustOverride Function AddSGW_Configuracion(ByVal cfg_PortalID As Integer, ByVal cfg_Descripcion As String, ByVal cfg_Valor As String) As Integer

        Public MustOverride Sub UpdateSGW_Configuracion(ByVal idConfig As Integer, ByVal cfg_PortalID As Integer, ByVal cfg_Descripcion As String, ByVal cfg_Valor As String)

        Public MustOverride Sub DeleteSGW_Configuracion(ByVal idConfig As Integer)

        Public MustOverride Function GetSGW_ConfiguracionIDBycfg_Descripcion(ByVal cfg_PortalID As Integer, ByVal cfg_Descripcion As String) As Integer


#End Region

#Region "Private methods"

        ' dynamically create provider
        Private Shared Sub CreateProvider()
            If objProvider Is Nothing Then
                objProvider = CType(Framework.Reflection.CreateObject("data", "SGW.ComunicadorWeb", ""), DataProvider)
            End If
        End Sub

#End Region

#Region "Lookup data providers"

#End Region




    End Class


End Namespace

